4.1 - Useful game classes to make mods
This chapter has the only meaning of showing different game classes that can be used to make a mod.
The dll in red next to the class is the dll which needs to be referenced in the mod project to use it.
LocalPlayer Sons.dll
It's the player class. Starting from it we have unlimited options to play with, examples are:
- control the inventory: LocalPlayer.Inventory
- control the first person character: LocalPlayer.FpCharacter
- control the player stats: LocalPlayer.Vitals
- control the player camera: LocalPlayer.MainCam and LocalPlayer.CamRotator
PlayerInventory Sons.dll
Controls over the player inventory:
- Adding an item: LocalPlayer.Inventory.AddItem(itemId, amount)
- Removing an item: LocalPlayer.Inventory.RemoveItem(itemId, amount)
- Equpping an item: LocalPlayer.Inventory.TryEquip(itemId, false)
Vitals Sons.dll
Controls over the player stats (health, stamina etc.)
- Changing player health: LocalPlayer.Vitals.SetHealth(value)
- Checking if player is alive: LocalPlayer.Vitals.IsAlive()
FirstPersonCharacter Sons.dll
Controls over the player movement (speed, jump etc.)
- Changing player run speed: LocalPlayer.FpCharacter.SetRunSpeed(value)
- Changing the player jump force: LocalPlayer.FpCharacter.SetSuperJump(multiplierValue)
- Changing the player swim speed: LocalPlayer.FpCharacter.SetSwimSpeed(value)
VailActorManager Sons.Ai.Vail.dll
The class with which we can do stuff with enemies and also animals in game:
- Getting the active actors: VailActorManager.GetActiveActors()
- Deleting all active actors: VailActorManager.ClearAll()
ItemDatabaseManager Sons.Item.dll
Class that contains references to all the game items:
- Getting data of all the items: ItemDatabaseManager.Items
- Getting data of an item by ID: ItemDatabaseManager.ItemById(itemId)
- Getting data of an item by name: ItemDatabaseManager.ItemByName(itemName)
ItemHotkeyController & HotkeySaveData Sons.dll
Controls and data of hotkeyed items.
DebugConsole Sons.dll
The in game DebugConsole class:
- can call all the commands the debug console has